import {
  Column,
  CreateDateColumn,
  Entity,
  PrimaryGeneratedColumn,
} from 'typeorm';

@Entity('tb_comment', {
  comment: '评论表',
})
export class Comment {
  @PrimaryGeneratedColumn('increment', { comment: '自增主键', unsigned: true })
  id: number;

  @Column({ comment: '用户ID' })
  userId: number;

  @Column({ comment: '媒体ID' })
  mediaId: number;

  @Column({ comment: '文字评论' })
  content: string;

  @Column({ comment: '评论附件', type: 'text', nullable: true })
  annexs: string;

  @Column({ comment: '匿名评论', type: 'tinyint', default: false })
  anonymous: boolean;

  @Column({ comment: '是否显示', type: 'tinyint', default: true })
  display: boolean;

  @CreateDateColumn({ comment: '评论时间' })
  time: Date;
}
